<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        *{
            margin: 0;
            padding:0;
        }
        .form{
            width:300px;
            margin: 80px auto 0;
        }
        .form-item{
            margin-bottom: 10px;
        }
        textarea{
            vertical-align: top;
        }
    </style>
</head>
<body>
<form action="" class="form">
    <div class="form-item">
        <label for="">姓名：</label>
        <input type="text" fm-verify="required" name="name" data-name="姓名" autocomplete="off">
    </div>
    <div class="form-item">
        <label for="">手机：</label>
        <input type="text" fm-verify="required|phone" name="phone" data-name="手机">
    </div>
    <div class="form-item">
        <label for="">邮箱：</label>
        <input type="text" fm-verify="required|email" name="email" data-name="邮箱" autocomplete="off">
    </div>
    <div class="form-item">
        <label for="">性别：</label>
        <input type="radio" name="sex" value="1">男
        <input type="radio" name="sex" value="2">女
    </div>
    <div class="form-item">
        <label for="">年龄：</label>
        <input type="text" fm-verify="required|number" name="age" data-name="年龄">
    </div>
    <div class="form-item">
        <label for="">爱好：</label>
        <input type="checkbox" name="like" value="31">打球
        <input type="checkbox" name="like" value="32">运动
        <input type="checkbox" name="like" value="33">看书
        <input type="checkbox" name="like" value="34">泡吧
    </div>
    <div class="form-item">
        <label for="">其他：</label>
        <input type="text" name="other">
    </div>
    <div class="form-item">
        <label for="">身份证：</label>
        <input type="text" name="idCard" fm-verify="idCard" data-name="身份证">
    </div>
    <div class="form-item">
        <label for="">城市：</label>
        <select name="select" id="">
            <option value="武汉">武汉</option>
            <option value="上海">上海</option>
            <option value="南京">南京</option>
            <option value="北京">北京</option>
        </select>
    </div>
    <div class="form-item">
        <label for="">备注：</label>
        <textarea name="remark" cols="30" rows="10"></textarea>
    </div>
    <a href="javascript:exFun();">提交</a>
</form>



<script src="../js/jquery.min.js"></script>
<script src="../js/JsForm.js"></script>
<script>
var exFun=function(){
    JsForm('.form').submit(function(r){
        if(r.code==1){
            console.log('提交表单--:'+r.result);
        }else{
            console.log('错误提示：'+r.msg);
        }
    },1)
}
</script>
</body>
</html>
